module.exports = class extends think.Model {
  async list({ cate_id, name, pageSize = 10, pageNum = 1 }) {
    const where = {};
    if (name) where.name = ["like", `%${name}%`];
    if (cate_id) where.cate_id = cate_id;
    const data = await this.where(where)
      .page(pageNum, pageSize)
      .countSelect();
    return data;
  }
};
